import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '所属机构',
    align: "center",
    dataIndex: 'belongingDepart_dictText'
  },
  {
    title: '区域类型',
    align: "center",
    dataIndex: 'regionType_dictText'
  },
  {
    title: '储罐编号',
    align: "center",
    dataIndex: 'number'
  },
  {
    title: '储罐名称',
    align: "center",
    dataIndex: 'name'
  },
  {
    title: '储罐位号',
    align: "center",
    dataIndex: 'tag'
  },
  {
    title: '储存介质中文名称',
    align: "center",
    dataIndex: 'mediumName'
  },
  {
    title: '储罐材质',
    align: "center",
    dataIndex: 'material'
  },
  {
    title: '火灾危险等级',
    align: "center",
    dataIndex: 'fireDangerGrade_dictText'
  },
  {
    title: '储存介质',
    align: "center",
    dataIndex: 'medium'
  },
  {
    title: '介质CAS号',
    align: "center",
    dataIndex: 'mediumCas'
  },
  {
    title: '形态',
    align: "center",
    dataIndex: 'mediumForm'
  },
  {
    title: '化学品类别',
    align: "center",
    dataIndex: 'chemicalClass_dictText'
  },
  {
    title: '规格（D*H)mm',
    align: "center",
    dataIndex: 'specification'
  },
  {
    title: '设计容积（m3）',
    align: "center",
    dataIndex: 'designVolume'
  },
  {
    title: '储罐型式',
    align: "center",
    dataIndex: 'tankType_dictText'
  },
  {
    title: '储罐形式',
    align: "center",
    dataIndex: 'tankForm_dictText'
  },
  {
    title: '储罐设计储存能力-质量(T)',
    align: "center",
    dataIndex: 'storageQuality'
  },
  {
    title: '危化品重大危险源临界量(T)',
    align: "center",
    dataIndex: 'criticalQuantity_dictText'
  },
  {
    title: 'MAC最大允许浓度(有毒气体)',
    align: "center",
    dataIndex: 'macMaxConcentration'
  },
  {
    title: '储罐设计压力',
    align: "center",
    dataIndex: 'designPressure'
  },
  {
    title: '正常工作压力上限',
    align: "center",
    dataIndex: 'maxStress'
  },
  {
    title: '正常工作温度上限',
    align: "center",
    dataIndex: 'maxTemperature'
  },
  {
    title: '重点监管危险化工工艺名称',
    align: "center",
    dataIndex: 'processType'
  },
  {
    title: '设计液位高度',
    align: "center",
    dataIndex: 'designLevelHeight'
  },
  {
    title: '经度',
    align: "center",
    dataIndex: 'longitude'
  },
  {
    title: '纬度',
    align: "center",
    dataIndex: 'latitude'
  },
  {
    title: '应急处置',
    align: "center",
    dataIndex: 'emergencyDisposal'
  },
  {
    title: '状态',
    align: "center",
    dataIndex: 'status_dictText'
  },
  {
    title: '上传文件',
    align: "center",
    dataIndex: 'doc',
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "区域类型",
    field: 'regionType',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "regionType"
    },
    //colProps: {span: 6},
  },
  {
    label: "储罐编号",
    field: 'number',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "储罐名称",
    field: 'name',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "火灾危险等级",
    field: 'fireDangerGrade',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "fireDangerGrade"
    },
    //colProps: {span: 6},
  },
  {
    label: "储存介质",
    field: 'medium',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "化学品类别",
    field: 'chemicalClass',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "chemicalClass"
    },
    //colProps: {span: 6},
  },
  {
    label: "储罐型式",
    field: 'tankType',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "tankType"
    },
    //colProps: {span: 6},
  },
  {
    label: "储罐形式",
    field: 'tankForm',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "tankForm"
    },
    //colProps: {span: 6},
  },
  {
    label: "危化品重大危险源临界量(T)",
    field: 'criticalQuantity',
    component: 'JDictSelectTag',
    componentProps:{
    },
    //colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '所属机构',
    field: 'belongingDepart',
    component: 'JSelectDept',
  },
  {
    label: '区域类型',
    field: 'regionType',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "regionType"
    },
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入区域类型!'},
             ];
    },
  },
  {
    label: '储罐编号',
    field: 'number',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入储罐编号!'},
             ];
    },
  },
  {
    label: '储罐名称',
    field: 'name',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入储罐名称!'},
             ];
    },
  },
  {
    label: '储罐位号',
    field: 'tag',
    component: 'Input',
  },
  {
    label: '储存介质中文名称',
    field: 'mediumName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入储存介质中文名称!'},
             ];
    },
  },
  {
    label: '储罐材质',
    field: 'material',
    component: 'Input',
  },
  {
    label: '火灾危险等级',
    field: 'fireDangerGrade',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "fireDangerGrade"
    },
  },
  {
    label: '储存介质',
    field: 'medium',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入储存介质!'},
             ];
    },
  },
  {
    label: '介质CAS号',
    field: 'mediumCas',
    component: 'Input',
  },
  {
    label: '形态',
    field: 'mediumForm',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入形态!'},
             ];
    },
  },
  {
    label: '化学品类别',
    field: 'chemicalClass',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "chemicalClass"
    },
  },
  {
    label: '规格（D*H)mm',
    field: 'specification',
    component: 'Input',
  },
  {
    label: '设计容积（m3）',
    field: 'designVolume',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入设计容积（m3）!'},
             ];
    },
  },
  {
    label: '储罐型式',
    field: 'tankType',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "tankType"
    },
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入储罐型式!'},
             ];
    },
  },
  {
    label: '储罐形式',
    field: 'tankForm',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "tankForm"
    },
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入储罐形式!'},
             ];
    },
  },
  {
    label: '储罐设计储存能力-质量(T)',
    field: 'storageQuality',
    component: 'Input',
  },
  {
    label: '危化品重大危险源临界量(T)',
    field: 'criticalQuantity',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: ""
    },
  },
  {
    label: 'MAC最大允许浓度(有毒气体)',
    field: 'macMaxConcentration',
    component: 'Input',
  },
  {
    label: '储罐设计压力',
    field: 'designPressure',
    component: 'Input',
  },
  {
    label: '正常工作压力上限',
    field: 'maxStress',
    component: 'Input',
  },
  {
    label: '正常工作温度上限',
    field: 'maxTemperature',
    component: 'Input',
  },
  {
    label: '重点监管危险化工工艺名称',
    field: 'processType',
    component: 'Input',
  },
  {
    label: '设计液位高度',
    field: 'designLevelHeight',
    component: 'Input',
  },
  {
    label: '经度',
    field: 'longitude',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入经度!'},
             ];
    },
  },
  {
    label: '纬度',
    field: 'latitude',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入纬度!'},
             ];
    },
  },
  {
    label: '应急处置',
    field: 'emergencyDisposal',
    component: 'InputTextArea',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入应急处置!'},
             ];
    },
  },
  {
    label: '状态',
    field: 'status',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "normalOrStop"
    },
  },
  {
    label: '上传文件',
    field: 'doc',
    component: 'JUpload',
    componentProps:{
     },
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  belongingDepart: {title: '所属机构',order: 0,view: 'sel_depart', type: 'string',},
  regionType: {title: '区域类型',order: 1,view: 'list', type: 'string',dictCode: 'regionType',},
  number: {title: '储罐编号',order: 2,view: 'text', type: 'string',},
  name: {title: '储罐名称',order: 3,view: 'text', type: 'string',},
  tag: {title: '储罐位号',order: 4,view: 'text', type: 'string',},
  mediumName: {title: '储存介质中文名称',order: 5,view: 'text', type: 'string',},
  material: {title: '储罐材质',order: 6,view: 'text', type: 'string',},
  fireDangerGrade: {title: '火灾危险等级',order: 7,view: 'list', type: 'string',dictCode: 'fireDangerGrade',},
  medium: {title: '储存介质',order: 8,view: 'text', type: 'string',},
  mediumCas: {title: '介质CAS号',order: 9,view: 'text', type: 'string',},
  mediumForm: {title: '形态',order: 10,view: 'text', type: 'string',},
  chemicalClass: {title: '化学品类别',order: 11,view: 'list', type: 'string',dictCode: 'chemicalClass',},
  specification: {title: '规格（D*H)mm',order: 12,view: 'text', type: 'string',},
  designVolume: {title: '设计容积（m3）',order: 13,view: 'text', type: 'string',},
  tankType: {title: '储罐型式',order: 14,view: 'radio', type: 'string',},
  tankForm: {title: '储罐形式',order: 15,view: 'list', type: 'string',dictCode: 'tankForm',},
  storageQuality: {title: '储罐设计储存能力-质量(T)',order: 16,view: 'text', type: 'string',},
  criticalQuantity: {title: '危化品重大危险源临界量(T)',order: 17,view: 'list', type: 'string',},
  macMaxConcentration: {title: 'MAC最大允许浓度(有毒气体)',order: 18,view: 'text', type: 'string',},
  designPressure: {title: '储罐设计压力',order: 19,view: 'text', type: 'string',},
  maxStress: {title: '正常工作压力上限',order: 20,view: 'text', type: 'string',},
  maxTemperature: {title: '正常工作温度上限',order: 21,view: 'text', type: 'string',},
  processType: {title: '重点监管危险化工工艺名称',order: 22,view: 'text', type: 'string',},
  designLevelHeight: {title: '设计液位高度',order: 23,view: 'text', type: 'string',},
  longitude: {title: '经度',order: 24,view: 'text', type: 'string',},
  latitude: {title: '纬度',order: 25,view: 'text', type: 'string',},
  emergencyDisposal: {title: '应急处置',order: 26,view: 'textarea', type: 'string',},
  status: {title: '状态',order: 27,view: 'radio', type: 'string',},
  doc: {title: '上传文件',order: 28,view: 'file', type: 'string',},
};
